package center.wxp.sentinel.service.impl;

import center.wxp.sentinel.service.UrlBlockHandler;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Service
public class CustomerUrlBlockHandler implements UrlBlockHandler {
    public void block(HttpServletRequest request, HttpServletResponse response, BlockException ex) {
        ErrorMsg msg = null;
        if (ex instanceof FlowException) {
            ex.printStackTrace();
            System.out.println("限流了");
        }
    }
}
